﻿using System;
using System.Windows.Forms;
using InicioDeSesion;

namespace ModuloDeInventario
{
    public partial class Fmp : Form
    {
        
        public Fmp()
        {
            InitializeComponent();
        }

        private void Fmp_Load(object sender, EventArgs e)
        {
            if (Program1.modi)
            {
                bcontrol.Visible = false;
            }
            if (Program1.ofi)
            {
                breporte.Enabled = false;
                bcontrol.Visible = false;
            }
        }

        Fap fap = new Fap();
        Falp falp = new Falp();
        Faprod faprod = new Faprod();
        Fre fre = new Fre();
        Frs frs = new Frs();
        Frd frd = new Frd();
        Fcu fcu = new Fcu();

        private void Fmp_FormClosing(object sender, FormClosingEventArgs e)
        {
            Application.Exit();
        }

        private void bsalir_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void baprov_MouseMove(object sender, MouseEventArgs e)
        {
            label12.Visible = false;
            pictureBox9.Visible = false;
            label2.Visible = true;
            pictureBox2.Visible = true;
        }

        private void baprov_MouseLeave(object sender, EventArgs e)
        {
            label12.Visible = true;
            pictureBox9.Visible = true;
            label2.Visible = false;
            pictureBox2.Visible = false;
        }

        private void balp_MouseLeave(object sender, EventArgs e)
        {
            label12.Visible = true;
            pictureBox9.Visible = true;
            label3.Visible = false;
            pictureBox3.Visible = false;
        }

        private void balp_MouseMove(object sender, MouseEventArgs e)
        {
            label12.Visible = false;
            pictureBox9.Visible = false;
            label3.Visible = true;
            pictureBox3.Visible = true;
        }

        private void bap_MouseMove(object sender, MouseEventArgs e)
        {
            label12.Visible = false;
            pictureBox9.Visible = false;
            label4.Visible = true;
            pictureBox4.Visible = true;
        }

        private void bre_MouseMove(object sender, MouseEventArgs e)
        {
            label12.Visible = false;
            pictureBox9.Visible = false;
            label5.Visible = true;
            pictureBox5.Visible = true;
        }

        private void brs_MouseMove(object sender, MouseEventArgs e)
        {
            label12.Visible = false;
            pictureBox9.Visible = false;
            label6.Visible = true;
            pictureBox5.Visible = true;
        }

        private void brd_MouseMove(object sender, MouseEventArgs e)
        {
            label12.Visible = false;
            pictureBox9.Visible = false;
            label7.Visible = true;
            pictureBox6.Visible = true;
        }

        private void bcerrarsesion_MouseMove(object sender, MouseEventArgs e)
        {
            label12.Visible = false;
            pictureBox9.Visible = false;
            label8.Visible = true;
            pictureBox1.Visible = true;
        }

        private void bap_MouseLeave(object sender, EventArgs e)
        {
            label12.Visible = true;
            pictureBox9.Visible = true;
            label4.Visible = false;
            pictureBox4.Visible = false;
        }

        private void bre_MouseLeave(object sender, EventArgs e)
        {
            label12.Visible = true;
            pictureBox9.Visible = true;
            label5.Visible = false;
            pictureBox5.Visible = false;
        }

        private void brs_MouseLeave(object sender, EventArgs e)
        {
            label12.Visible = true;
            pictureBox9.Visible = true;
            label6.Visible = false;
            pictureBox5.Visible = false;
        }

        private void brd_MouseLeave(object sender, EventArgs e)
        {
            label12.Visible = true;
            pictureBox9.Visible = true;
            label7.Visible = false;
            pictureBox6.Visible = false;
        }

        private void bcerrarsesion_MouseLeave(object sender, EventArgs e)
        {
            label12.Visible = true;
            pictureBox9.Visible = true;
            label8.Visible = false;
            pictureBox1.Visible = false;
        }

        private void bsalir_MouseMove(object sender, MouseEventArgs e)
        {
            label12.Visible = false;
            pictureBox9.Visible = false;
            label9.Visible = true;
            pictureBox7.Visible = true;
        }

        private void bsalir_MouseLeave(object sender, EventArgs e)
        {
            label12.Visible = true;
            pictureBox9.Visible = true;
            label9.Visible = false;
            pictureBox7.Visible = false;
        }

        private void balp_Click(object sender, EventArgs e)
        {
            this.Hide();
            falp.Show();
        }

        private void bap_Click(object sender, EventArgs e)
        {
            this.Hide();
            MessageBox.Show("Por Favor Tenga En Cuenta.\nPrevio A La Creación De Un Producto Tiene Que Haber Creado Un Proveedor Y Una Línea De Productos O Tenerlos Disponibles.");
            faprod.Show();
        }

        private void bre_Click(object sender, EventArgs e)
        {
            this.Hide();
            MessageBox.Show("Por Favor Tenga En Cuenta. \nPrevio A La Introducción De Productos, El Producto Debe De Existir En El Inventario.");
            fre.Show();
        }

        private void brs_Click(object sender, EventArgs e)
        {
            this.Hide();
            MessageBox.Show("Por Favor Tenga En Cuenta. \nPrevio A Darle De Baja A Un Producto, La Factura Debe Existir En El Sistema Y Este Es Un Proceso Sobre El Cual No Tenemos Control.");
            frs.Show();
        }

        private void brd_Click(object sender, EventArgs e)
        {
            this.Hide();
            MessageBox.Show("Por Favor Tenga En Cuenta. \nPrevio A Realizar Una Devolución De Un Producto, La Factura Debe Existir En El Sistema Y Este Es Un Proceso Sobre El Cual No Tenemos Control.");
            frd.Show();
        }

        private void baprov_Click(object sender, EventArgs e)
        {
            this.Hide();
            fap.Show();
        }

        private void bcerrarsesion_Click(object sender, EventArgs e)
        {
            this.Hide();
            Fis fis = new Fis();
            fis.Show();
        }

        private void bcontrol_Click(object sender, EventArgs e)
        {
            this.Hide();
            fcu.Show();
        }

        private void bcontrol_MouseMove(object sender, MouseEventArgs e)
        {
            label12.Visible = false;
            pictureBox9.Visible = false;
            label10.Visible = true;
            pictureBox1.Visible = true;
        }

        private void bcontrol_MouseLeave(object sender, EventArgs e)
        {
            label12.Visible = true;
            pictureBox9.Visible = true;
            label10.Visible = false;
            pictureBox1.Visible = false;
        }

        private void breporte_Click(object sender, EventArgs e)
        {
            if (faprod.EvaluacionReportes() != 0)
            {
                this.Hide();
                new Frp().Show();
            }
            else
            {
                MessageBox.Show("No Hay Ningún Registro En La Tabla Productos Por Eso El Reporte Se Mostrara Vacío.");
                this.Hide();
                new Frp().Show(); 
            }
        }

        private void breporte_MouseMove(object sender, MouseEventArgs e)
        {
            label12.Visible = false;
            pictureBox9.Visible = false;
            label11.Visible = true;
            pictureBox8.Visible = true;
        }

        private void breporte_MouseLeave(object sender, EventArgs e)
        {
            label12.Visible = true;
            pictureBox9.Visible = true;
            label11.Visible = false;
            pictureBox8.Visible = false;
        }
    }
}
